home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / LaserWriterIIsc (New GX v1.1) / OldAPIMessageIntf.c < prev    next >
Encoding:
Text File  |  1996-03-20  |  18.5 KB  |  645 lines  |  [TEXT/MPS ]

  1. /*---------------------------------------------------------------------------
  2. FILENAME
  3.     OldAPIMessageIntf.c
  4.  
  5. DESCRIPTION
  6.     This module contains the routines which implement the old API messages
  7.     that the LaserWriter SC driver overrides.  Much of the logic in this
  8.     module was gleaned from the original LaserWriter IISC driver, and so
  9.     some of the calulations may seem a little strange.  In order to maintain
  10.     compatibility with the old driver's logic, we must preserve much of the
  11.     old logic.
  12.         
  13. COPYRIGHT
  14.      Copyright Apple Computer, Inc. 1989-1992
  15.      All rights reserved. 
  16.         
  17. INTERFACE ROUTINES:
  18.  
  19.     SD_PrValidate
  20.     SD_ConvertPrintRecordTo
  21.     SD_ConvertPrintRecordFrom
  22.  
  23. -------------------------------------------------------------------------------- */
  24.  
  25. // Include the standard Mac header files 
  26. #include "MacIncludes.h"
  27.  
  28. // Include the new QuickDraw GX graphics header files 
  29. #include <GXGraphics.h>
  30. #include <GraphicsLibraries.h>
  31. #include <GXMath.h>
  32.  
  33. // Include the required Printing Manager header files 
  34. #include <GXPrinting.h>
  35. #include <GXPrinterDrivers.h>
  36. #include <Collections.h>
  37. #include <GXMessages.h>
  38.  
  39. // Include the internal driver constants and types used by this module 
  40. #include "LaserSCResources.h"
  41. #include "OldAPIMessageIntf.h"
  42.  
  43.  
  44. /***************************************************************************************
  45. *                                         INTERNAL ROUTINES                                                    *
  46. ***************************************************************************************/
  47.  
  48.  
  49. /****************************************************************************************
  50.  
  51.                             EmulatePages
  52.                             
  53.     function:
  54.                 This function takes a paper rectangle, and computes the rPage
  55.                 rectangle for it.  It uses the old LaserWriter IISC driver's page size 
  56.                 calculation "algorithm" (if it can be called such).
  57.                 
  58.     parameters:                
  59.                 hPrint        target print record whose rPage rect is updated
  60.  
  61.     returns:
  62.                 none
  63.     
  64. ****************************************************************************************/
  65. void EmulatePages(THPrint    hPrint)
  66. {
  67.     TPrInfo    *pPrInfo;
  68.     TPrStl    *pPrStl;
  69.     short        dvPaper;         // the "calculated" paper sizes
  70.     short        dhPaper;            
  71.     short        dvPage;             // the "calculated" page sizes
  72.     short        dhPage;            
  73.     short        iOneFourth;        // fudge factors which don't quite equal their names
  74.     short        iTwoFifths;        
  75.     short        iVMaxInch;        // memory limitation on the page sizes.
  76.     short        iHMaxBytes;
  77.     short        scanBits;        // the eventual # of bits across a line on the page (truncated)
  78.     short        scanLines;        // the eventual # of lines on the page (truncated)
  79.     short        iTemp;            // temporary swapping variable for landscape
  80.     short        hOff;                // used to calculated the offset paper rectangle
  81.     short        vOff;
  82.  
  83.     
  84.     pPrInfo    =    &((*hPrint)->prInfo);        
  85.     pPrStl    =    &((*hPrint)->prStl);        
  86.     
  87.  
  88.     dvPaper     =     (pPrStl->iPageV * pPrInfo->iVRes) / kMysticPaperFract;
  89.     dhPaper     =     (pPrStl->iPageH * pPrInfo->iHRes) / kMysticPaperFract;
  90.     
  91.     
  92.     // Weird fudge factors from Dave Casseres. No, I don't understand them.  No,
  93.     //    he apparently doesn't either, anymore. 
  94.         
  95.     iOneFourth    =    (pPrInfo->iHRes + 2) / 4;                // this isn't even 1/4th.
  96.     iTwoFifths    =    ((pPrInfo->iHRes << 2) + 5) / 10;    // nor is this 2/5ths!
  97.     
  98.     
  99.     // Boundary condition for large page sizes (legal > 1400 which is 11.666666667").
  100.     //    If the paper is smaller than that, then we just do the regular calculation.
  101.     //    Otherwise, we restrict the size to 12.5" on the IISC (25/2). Further, we
  102.     //    restrict the horizontal dimensions to 6.72 inches (memory limitation on 1 Mb printers
  103.         
  104.     if (pPrStl->iPageV <= 1400)
  105.     {
  106.         iVMaxInch     =     pPrStl->iPageV;
  107.         iHMaxBytes    =    kLetterRowBytes;
  108.     }
  109.     else
  110.     {
  111.         iVMaxInch     =     (25 * kMysticPaperFract) / 2;
  112.         iHMaxBytes    =    kLegalRowBytes;
  113.     }
  114.  
  115.  
  116.     // Force the horizontal dimension to fit within the laser's restrictions:
  117.     //    iHMaxBytes was just set. For letter, it's 8" (300 rowBytes). Multiply by the
  118.     //    horizontal resolution (say 72), and divide by high-resolution (300 dpi).
  119.     //    Multiply by 8 (<< 3), since we want coordinates, and the iHMaxBytes is
  120.     //    a byte count.  Always do divisions last, in order to keep precision. 
  121.     //    dhPaper is the paper size horizontally in rendering units (72 or 300). 
  122.     //    It really ought to be in one unit or the other, but in emulation mode,
  123.     //    it's in whatever the app selected.  We force the page size to fit within
  124.     //    the laser's restricted area by forcing about a 1/4" border. We do the same
  125.     //    vertically, with approximately a 2/5" border total. We truncate the results
  126.     //    (why to 16ths and to 2nds? I don't know). 
  127.     
  128.     scanBits = ((iHMaxBytes * pPrInfo->iHRes) << 3) / kHorizHighRes;
  129.     if (scanBits > (dhPaper - iOneFourth))
  130.         scanBits = dhPaper - iOneFourth;
  131.     scanBits = (scanBits >> 4) << 4;        // number of bits on a single line
  132.  
  133.  
  134.     scanLines = (iVMaxInch * pPrInfo->iVRes) / iPrPgFract;
  135.     if (scanLines > (dvPaper - iTwoFifths))
  136.         scanLines = dvPaper - iTwoFifths;
  137.     scanLines = (scanLines >> 1) << 1;        // number of lines on the page
  138.     
  139.  
  140.     // set the page size based on the orientation. Portrait uses the default
  141.     //    definitions: bits for horizontal and lines for vertical. 
  142.         
  143.     if ( TestBit((*hPrint)->prStl.wDev, kPortraitBit) )
  144.     {
  145.         dhPage = scanBits;
  146.         dvPage = scanLines;
  147.     }
  148.     else    // landscape
  149.     {
  150.         dhPage     = scanLines;
  151.         dvPage     = scanBits;
  152.         
  153.         // Reverse the meanings of paper in landscape as well. 
  154.         iTemp     = dhPaper;
  155.         dhPaper     = dvPaper;
  156.         dvPaper     = iTemp;
  157.     }
  158.  
  159.     SetRect( &(pPrInfo->rPage), 0, 0, dhPage, dvPage );
  160.  
  161.     // Create the paper size and store it in the print record 
  162.     
  163.     hOff = (dhPage - dhPaper) / 2;
  164.     vOff = (dvPage - dvPaper) / 2;
  165.     SetRect( & ((*hPrint)->rPaper) , hOff, vOff, dhPaper+hOff, dvPaper+vOff );
  166.  
  167.     // Preserve the rPaper rectangle in the printX array starting at word 5.  This is done
  168.     // to maintain compatibility with the old LaserWriter SC driver
  169.     {
  170.         BlockMove((Ptr) &((*hPrint)->rPaper), (Ptr) &((*hPrint)->printX[5]), sizeof(Rect));
  171.     }
  172. }
  173. /* EmulatePages */
  174.  
  175.  
  176. /****************************************************************************************
  177.  
  178.                             HandleZoom
  179.                             
  180.     function:
  181.                 This function handles zoom factors from PageSetup.  How does zooming work?  
  182.                 What we do is trick the application into doing the work for us by returning a 
  183.                 page size bigger than actual.  Thus when we render this into the original page
  184.                 size, we get a reduced image.
  185.                 
  186.     parameters:                
  187.                 hPrint            handle to the print record to change
  188.                 
  189.     returns:
  190.                 none
  191.     
  192. ****************************************************************************************/
  193.  
  194. void HandleZoom(THPrint    hPrint)
  195. {
  196.     gxUniversalPrintRecordPtr    pUniv;
  197.     Fixed                                zoomFactor;
  198.     Rect                                tempRect;
  199.  
  200.     // Convert print record into the universal form
  201.     SD_ConvertPrintRecordTo(hPrint);
  202.     
  203.     pUniv = (gxUniversalPrintRecordPtr) *hPrint;
  204.  
  205.     // Convert the reduction factor into a fixed zoom value 
  206.     zoomFactor = FixRatio(100, pUniv->reduction );
  207.     
  208.     // Notice that we don't zoom the device specific size, since zoom
  209.     //    factors "just" trick out the application side of things 
  210.  
  211.     tempRect = pUniv->appPage;
  212.     SetRect(&tempRect, FixRound( FixMul( (tempRect.left << 16),    zoomFactor) ), 
  213.                           FixRound( FixMul( (tempRect.top     << 16),     zoomFactor) ),
  214.                           FixRound( FixMul( (tempRect.right << 16), zoomFactor) ), 
  215.                           FixRound( FixMul( (tempRect.bottom << 16),zoomFactor) ));
  216.     pUniv->appPage = tempRect;
  217.             
  218.     tempRect = pUniv->appPaper;
  219.     SetRect(&tempRect, FixRound( FixMul( (tempRect.left << 16),    zoomFactor) ), 
  220.                           FixRound( FixMul( (tempRect.top     << 16),     zoomFactor) ),
  221.                           FixRound( FixMul( (tempRect.right << 16), zoomFactor) ), 
  222.                           FixRound( FixMul( (tempRect.bottom << 16),zoomFactor) ));
  223.     pUniv->appPaper = tempRect;
  224.         
  225.     
  226.     // Convert the print record back into the specific driver form
  227.     SD_ConvertPrintRecordFrom(hPrint);
  228. }
  229. /* HandleZoom */
  230.  
  231.  
  232. /****************************************************************************************
  233.  
  234.                             UpdatePrInfoPt
  235.                             
  236.     function:
  237.                 This function updates the prInfoPT portion of the print record.  The logic
  238.                 for updating the prInfoPT structure comes from the original LaserWriter
  239.                 SC driver.
  240.                 
  241.     parameters:                
  242.                 hPrint                handle to the print record to change
  243.                 calcDeviceRects    true to calc device rectangles
  244.                 
  245.     returns:
  246.                 none
  247.     
  248. ****************************************************************************************/
  249. void UpdatePrInfoPt(THPrint hPrint, Boolean calcDeviceRects)
  250. {
  251.     Rect        tempRect;
  252.     TPPrint    pPrint = *hPrint;
  253.     short        precFlags;
  254.     
  255.     // Initially assume the prInfoPT structure will be like that of prInfo
  256.     
  257.     pPrint->prInfoPT.iHRes = pPrint->prInfo.iHRes;
  258.     pPrint->prInfoPT.iVRes = pPrint->prInfo.iVRes;
  259.     pPrint->prInfoPT.rPage = pPrint->prInfo.rPage;
  260.     
  261.     precFlags = pPrint->prXInfo.iBandV;
  262.     
  263.     if (
  264.         (calcDeviceRects) && 
  265.         ( !TestBit(precFlags, kDevResBit) )    //    T => We're not imaging at device resolution
  266.         )
  267.     {
  268.         short        theRes = pPrint->prInfoPT.iHRes;
  269.         Fixed        scale;
  270.  
  271.     
  272.         // Compute the new resolution based upon the scaling factors
  273.         
  274.         if ( TestBit(precFlags, kScale75Bit) )
  275.         {
  276.             theRes = (theRes << 2) / 3;
  277.         }
  278.         else 
  279.         if ( TestBit(precFlags, kScale50Bit) )
  280.         {
  281.             theRes <<= 1;
  282.         }
  283.         else 
  284.         if ( TestBit(precFlags, kScale25Bit) )
  285.             theRes <<= 2;
  286.             
  287.         // Are we doing exact bitmap scaling, or scaling to the resolution of the device?
  288.         
  289.         if ( TestBit(precFlags, kExactBitBit) )
  290.             {
  291.             scale = FixRatio(kHorizHighExactRes, theRes);
  292.             theRes = kHorizHighExactRes;
  293.             }
  294.         else
  295.             {
  296.             scale = FixRatio(kHorizHighRes, theRes);
  297.             theRes = kHorizHighRes;
  298.             }
  299.             
  300.         // Update the resolution fields
  301.         
  302.         pPrint->prInfoPT.iHRes = theRes;
  303.         pPrint->prInfoPT.iVRes = theRes;        // the old driver doesn't update the iVRes field, but we will
  304.  
  305.         // Now we need to calculate the new rPage
  306.         tempRect =  pPrint->prInfoPT.rPage;
  307.     
  308.         // Calculate the device resolution rectangle
  309.         SetRect(&tempRect, FixRound( FixMul( (tempRect.left << 16),    scale) ), 
  310.                               FixRound( FixMul( (tempRect.top     << 16), scale) ),
  311.                               FixRound( FixMul( (tempRect.right << 16), scale) ), 
  312.                               FixRound( FixMul( (tempRect.bottom << 16), scale) ));
  313.     
  314.         // Store away the device page size
  315.         (*hPrint)->prInfoPT.rPage = tempRect;
  316.     }
  317.  
  318. }
  319. /* UpdatePrInfoPt */
  320.  
  321.  
  322.  
  323. /****************************************************************************************
  324.  
  325.                             UpdatePrintRecord
  326.                             
  327.     function:
  328.                 This function updates the print record based upon the application's
  329.                 calls to PrGeneral.
  330.                 
  331.     parameters:                
  332.                 hPrint                print record to update
  333.                 calcDeviceRects    true to calculate device rectangles, false to copy from apps
  334.  
  335.     returns:
  336.                 none
  337.     
  338. ****************************************************************************************/
  339. void UpdatePrintRecord(THPrint hPrint, Boolean calcDeviceRects)
  340. {
  341.     // emulate those crazy old style pages        
  342.     EmulatePages(hPrint);
  343.  
  344.     // Handle the case of zoom factors by scaling the rectangles
  345.     HandleZoom(hPrint);
  346.  
  347.     // Compute and fill in the devPage rectangle and the remainder of prInfoPT
  348.     UpdatePrInfoPt(hPrint, calcDeviceRects);
  349. }
  350. /* UpdatePrintRecord */
  351.  
  352.  
  353.  
  354. /***************************************************************************************
  355. *                                         INTERFACE ROUTINES                                                     *
  356. ***************************************************************************************/
  357.  
  358. /****************************************************************************************
  359.  
  360.                             SD_PrValidate
  361.                             
  362.     function:
  363.                 This function validates the print record.  If the passed-in print record contains
  364.                 valid information (see below), then it's updated based upon the application's
  365.                 calls to Prgeneral.  Otherwise, it is unchanged, and the return code is true.
  366.                 Otherwise, the print record is defaulted (with SD_PrintDefault), and the 
  367.                 return value is false.
  368.                 
  369.                 Validation:
  370.                     The upper byte of the wDev must be the ID of the device 
  371.                         (kPrinterID in Resources.h).
  372.                     The version of the print record must be current
  373.                         (oldLWSCPrintRecordVersion in Resources.h)
  374.                     (For new print records, we will validate all of the fields which are 
  375.                      public (e.g., paper size), not just these fields)
  376.                 
  377.     parameters:                
  378.                 hPrint                    print record to validate
  379.                 wasChanged                returns true if print record was invalid; false otherwise
  380.                 
  381.     returns:
  382.                 OSErr
  383.     
  384. ****************************************************************************************/
  385. OSErr SD_PrValidate(THPrint hPrint, Boolean *wasChanged)
  386. {
  387.     short        wDev;                        // device specific stuff in this word
  388.     Boolean    returnVal = true;        // initialize return value to "invalid"
  389.                                             //     Why is true == "invalid"? Nobody knows!
  390.     
  391.     // check the wDev.  The upper byte must be equal to kPrinterID.  We get the
  392.     //  wDev, and shift wDev DOWN eight.
  393.         
  394.     wDev =  (*hPrint)->prStl.wDev;
  395.     wDev >>= 8;                                // get just the device ID
  396.  
  397.  
  398.     // If the device id is equal, then check the version number of the print record.
  399.     //    Only if that is also equal to the current version, will we return false (valid).
  400.         
  401.     if (wDev == kPrinterID)
  402.         if ( ((*hPrint)->iPrVersion) == oldLWSCPrintRecordVersion )
  403.             returnVal = false;
  404.             
  405.  
  406.     // If the print record is not valid, then return the default print record.
  407.     // Otherwise, update the print record, based on the application's calls
  408.     // to PrGeneral.
  409.  
  410.     if (returnVal)
  411.         PrintDefault(hPrint);
  412.     else
  413.         UpdatePrintRecord(hPrint, false);
  414.         
  415.     *wasChanged = returnVal;
  416.     
  417.     return(noErr);
  418. }
  419. /* SD_PrValidate */
  420.  
  421.  
  422. /****************************************************************************************
  423.  
  424.                             SD_OpenDoc
  425.                             
  426.     function:     
  427.                 SD_OpenDoc is the first call for printing an old style document.  
  428.                 
  429.     
  430. ****************************************************************************************/
  431. OSErr SD_OpenDoc(    THPrint hPrint,                // old-style print record for this document
  432.                             TPPrPort *printingPort)
  433. {
  434.     OSErr    anErr;
  435.     
  436.     UpdatePrintRecord(hPrint, true);
  437.  
  438.     anErr = Forward_GXPrOpenDoc(hPrint, printingPort);
  439.     
  440.     return(anErr);
  441.     
  442. } /* SD_OpenDoc */
  443.  
  444. /****************************************************************************************
  445.  
  446.                             SD_ConvertPrintRecordTo
  447.                             
  448.     function:     
  449.                 SD_ConvertPrintRecordTo converts the fields of the print record for
  450.                 the device into the universal print record format.  
  451.                 
  452.     parameters:    
  453.                 hPrint        print record to convert to universal format
  454.     
  455.     returns:
  456.                 OSErr
  457.     
  458. ****************************************************************************************/
  459. OSErr SD_ConvertPrintRecordTo(THPrint hPrint)
  460. {
  461.     gxUniversalPrintRecordPtr    pUniv;
  462.     TPPrint                             pPrint;
  463.     short                                options = 0;
  464.     short                                oldFlags;
  465.  
  466.     pUniv = (gxUniversalPrintRecordPtr) *hPrint;
  467.     pPrint = *hPrint;
  468.     
  469.     // Convert paper feed settings (old and univ setting are switched)
  470.  
  471.     if ( pPrint->prStl.feed == oldPRECAutoFeed )
  472.         pUniv->feed = gxAutoFeed;
  473.     else
  474.         pUniv->feed = gxManualFeed;
  475.     
  476.     // Determine the new options field settings; univ and specific share this location
  477.  
  478.     oldFlags = pPrint->prXInfo.iBandV;
  479.  
  480.     if ( TestBit(oldFlags, kTextSmoothingBit) )
  481.         options |= gxTextSmoothing;
  482.         
  483.     if ( TestBit(oldFlags, kExactBitBit) )
  484.         options |= gxPreciseBitmap;
  485.         
  486.     if ( TestBit(oldFlags, kDevResBit) )
  487.         pUniv->appHRes = pUniv->appVRes = 300;
  488.     else
  489.         pUniv->appHRes = pUniv->appVRes = 72;
  490.         
  491.     pUniv->options = options;
  492.  
  493.     // We need to save the settings of the other flag bits from the old print record (e.g. fGrayScale,
  494.     // fDraftBits, etc.).  We save them in printX[18].
  495.     pUniv->printX[18] = oldFlags;
  496.     
  497.     // Now determine the scaling factor, if any, and designate the proper dialog button that
  498.     // corresponds to the scaling factor.  The userCluster1 field specifies the dialog button.
  499.     
  500.     if ( TestBit(oldFlags, kScale75Bit) )
  501.     {
  502.         pUniv->reduction = 75;
  503.         pUniv->userCluster1 = 1;
  504.     }
  505.     else 
  506.     if ( TestBit(oldFlags, kScale50Bit) )
  507.     {
  508.         pUniv->reduction = 50;
  509.         pUniv->userCluster1 = 2;
  510.     }
  511.     else 
  512.     if ( TestBit(oldFlags, kScale25Bit) )
  513.     {
  514.         pUniv->reduction = 25;
  515.         pUniv->userCluster1 = 3;
  516.     }
  517.     else     //    T => No scaling being performed
  518.     {
  519.         pUniv->reduction = 100;
  520.         pUniv->userCluster1 = 0;
  521.     }
  522.  
  523.     // Set the orientation properly
  524.  
  525.     if ( TestBit(pPrint->prStl.wDev, kPortraitBit) )
  526.         pUniv->orientation = gxPortraitOrientation;
  527.     else
  528.         pUniv->orientation = gxLandscapeOrientation;
  529.         
  530.     // Always assign these fields explicit values to ensure they don't cause problems
  531.     
  532.     pUniv->qualityMode     = gxBestQuality;
  533.     pUniv->firstTray         = gxFirstTray;
  534.     pUniv->remainingTray    = gxFirstTray;
  535.     pUniv->coverPage         = gxNoCoverPage;
  536.     pUniv->headMotion     = gxUnidirectionalMotion;
  537.     pUniv->saveFile         = gxNoFile;
  538.     
  539.     return(noErr);
  540. }
  541. /* SD_ConvertPrintRecordTo */
  542.  
  543.  
  544. /****************************************************************************************
  545.  
  546.                             SD_ConvertPrintRecordFrom
  547.                             
  548.     function:     
  549.                 SD_ConvertPrintRecordFrom converts the fields of the print record in 
  550.                 universal print record format into the print record format for the
  551.                 specific device. 
  552.                 
  553.     parameters:    
  554.                 hPrint        print record to convert to device specific format
  555.     
  556.     returns:
  557.                 OSErr
  558.     
  559. ****************************************************************************************/
  560. OSErr SD_ConvertPrintRecordFrom(THPrint hPrint)
  561. {
  562.     gxUniversalPrintRecordPtr    pUniv;
  563.     TPPrint                             pPrint;
  564.     short                                iBandV = 0;
  565.     short                                oldOptions;
  566.     short                                savedOldFlags;
  567.  
  568.     pUniv = (gxUniversalPrintRecordPtr) *hPrint;
  569.     pPrint = *hPrint;
  570.     
  571.     // Set the orientation properly
  572.  
  573.     if (pUniv->orientation == gxPortraitOrientation)
  574.         pPrint->prStl.wDev |= kPortraitBit;
  575.     else
  576.         pPrint->prStl.wDev &= ~kPortraitBit;
  577.  
  578.     // Convert paper feed settings (old and univ setting are switched)
  579.  
  580.     if ( pUniv->feed == gxAutoFeed )
  581.         pPrint->prStl.feed = oldPRECAutoFeed;
  582.     else
  583.         pPrint->prStl.feed = oldPRECManualFeed;
  584.  
  585.     // Set the flags in the iBandV field of the print record
  586.  
  587.     oldOptions = pUniv->options;
  588.     
  589.     if ( TestBit(oldOptions, gxTextSmoothing) )
  590.         iBandV |= kTextSmoothingBit;
  591.         
  592.     switch( pUniv->userCluster1 )    //    Based on the scaling dialog button setting, set the scaling factor
  593.     {
  594.         case 0:
  595.             break;
  596.             
  597.         case 1:
  598.             iBandV |= kScale75Bit;
  599.             break;
  600.             
  601.         case 2:
  602.             iBandV |= kScale50Bit;
  603.             break;
  604.             
  605.         case 3:
  606.             iBandV |= kScale25Bit;
  607.             break;
  608.     }
  609.     
  610.     if ( TestBit(oldOptions, gxPreciseBitmap) )
  611.         iBandV |= kExactBitBit;
  612.  
  613.     savedOldFlags = pUniv->printX[18];
  614.     
  615.     if (pUniv->appHRes != 72)
  616.         iBandV |= kDevResBit;
  617.  
  618.     if ( TestBit(savedOldFlags, kDraftBitsBit) )
  619.         iBandV |= kDraftBitsBit;
  620.  
  621.     if ( TestBit(savedOldFlags, kAbortChkBit) )
  622.         iBandV |= kAbortChkBit;
  623.  
  624.     if ( TestBit(savedOldFlags, kGrayScaleBit) )
  625.         iBandV |= kGrayScaleBit;
  626.  
  627.     // Initialize the remaining fields in the TPrXInfo structure
  628.     
  629.     pPrint->prXInfo.iBandV = iBandV;
  630.     pPrint->prXInfo.iBandH = 0;
  631.     pPrint->prXInfo.iDevBytes = 0;
  632.     pPrint->prXInfo.iBands = 0;
  633.     pPrint->prXInfo.bPatScale = kPatScale;
  634.     pPrint->prXInfo.bUlThick = 0;
  635.     pPrint->prXInfo.bUlOffset = 0;
  636.     pPrint->prXInfo.bUlShadow = 0;
  637.     pPrint->prXInfo.scan = scanTB;
  638.     pPrint->prXInfo.bXInfoX = 0;
  639.  
  640.     pPrint->printX[18] = 0;
  641.  
  642.     return(noErr);
  643. }
  644. /* SD_ConvertPrintRecordFrom */
  645.